<html>
    <head>
        <title>编辑法律法规</title>
        <style type="text/css">
            body{margin:0 auto;padding:0px;text-align:center}
            .titleDiv{margin-top:100px;}
            .titleLabel{display:inline-block;color: black;width:90px;margin-right: 3px;}
            .titleInput{display: inline-block;}
            .title{width:720px;height: 40px;border-radius: 2px;}
            .categoryDiv{margin-top: 15px;}
            .categoryLabel{display:inline-block;color: black;width:90px;margin-right: 3px;}
            .categoryInput{display:inline-block;}
            .category{width:720px;height: 40px;}
            .executionDiv{margin-top: 15px;}
            .executionLabel{display:inline-block;color: black;width:90px;margin-right: 3px;}
            .executionInput{display: inline-block; width:720px;}
            .contentDiv{margin-top: 15px;height:460px;}
            .contentLabel{display:inline-block;vertical-align:middle;color: black;width:90px;margin-right: 3px;}
            .contentText{display: inline-block; vertical-align:middle;}
            .textarea{width:720px;border-radius: 6px;height:300px;}
            .button{background:rgb(51,133,255);width:80px;height:30px;color: white;}
            .wordDiv{margin-top: 20px;}
            .wordLabel{display:inline-block;vertical-align:middle;color: black;width:90px;margin-right: 3px;}
            .wordText{display: inline-block;width:720px;}
            .word{margin-left: -360px;}
            .wordText p{margin-left: 80px;color:red;}
        </style>
        <script type="text/javascript" charset="utf-8" src="/js/ueditor.config.js"></script>
        <script type="text/javascript" charset="utf-8" src="/js/ueditor.all.min.js"> </script>
        <script type="text/javascript" charset="utf-8" src="/js/lang/zh-cn/zh-cn.js"></script>
    </head>
    <body>
        <form class="form" enctype="multipart/form-data" method="post" action="{{route('law_update_save')}}">
            <div class="titleDiv">
                <label class="titleLabel">法律法规标题</label>
                <div class="titleInput">
                    <input type="text" class="title" name="title" value="{{$law['title']}}" placeholder="请输入文章标题" />
                </div>
            </div>

            <div class="categoryDiv">
                <label class="categoryLabel">法律法规分类</label>
                <div class="categoryInput">
                    <select name="categoryId" class="category">
                        @foreach($law_category as $category)
                        <option value="{{$category['id']}}" @if($category['id']==$law['categoryId'])selected @endif>{{$category['name']}}</option>
                        @endforeach
                    </select>
                </div>
            </div>

            <div class="executionDiv">
                <label class="executionLabel">法律法规属性</label>
                <div class="executionInput">
                    <input type="radio" name="execution" value="0" @if($law['execution']==0)checked="true" 
                    @endif/>无属性
                    <input type="radio" name="execution" value="1" @if($law['execution']==1)checked="true" 
                    @endif/>强制性
                    <input type="radio" name="execution" value="2" @if($law['execution']==2)checked="true" @endif/>推荐性
                </div>
            </div>

            <div class="contentDiv">
                <label class="contentLabel">法律法规详情</label>
                <div class="contentText">
                    <script id="content" type="text/plain" class="textarea" name="content">{!! $law_detail['content'] !!}</script>
                </div>
            </div>

            <div class="wordDiv">
                <label class="wordLabel">上传word文件</label>
                <div class="wordText">
                    <input type="file" name="word" class="word"/><p>更新不上传文件则文件是原来上传文件</p>
                </div>
            </div>
            {{csrf_field()}}
            <div class="submit">
                <input type="hidden" name="id" value="{{$law['id']}}"/>
                <input type="submit" class="button" name="button" value="提交"/>
            </div>
        </form>
    </body>
    <script type="text/javascript">
        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        var ue = UE.getEditor('content',{autoHeightEnabled: false});
    </script>
</html>